package com.softline.documentsmall.dao;


import com.softline.documentsmall.entity.DetailSubmitPageQueryVo;
import com.softline.documentsmall.entity.EntryDetailsSubmit;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author zhongweicheng
 * @date 2020/8/25 15:32
 */
@Mapper
public interface EntryDetailSubmitMapper {

    List<EntryDetailsSubmit> findByParams(@Param("entryDetailsSubmit") EntryDetailsSubmit entryDetailsSubmit,@Param("currPage")Integer currPage,@Param("pageSize")Integer pageSize);

    void softDeleteEntryDetailSumbitById(@Param("id") Integer id);

    void userUpdateEntryDetailSumbitById(EntryDetailsSubmit entryDetailsSubmit);

    void insertEntryDetailSumbit(EntryDetailsSubmit entryDetailsSubmit);

    void adminUpdateEntryDetailSubmitById(EntryDetailsSubmit entryDetailsSubmit);

    Integer findApproveStateById(@Param("id") Integer id);

    EntryDetailsSubmit findById(@Param("id")Integer id);

    EntryDetailsSubmit findByDictionaryIdLanguageTitle(@Param("dictionaryId")Integer dictionaryId,@Param("language")String language,@Param("title")String title);

    EntryDetailsSubmit isApproveInsert(@Param("dictionaryId") Integer dictionaryId,@Param("language") String language,@Param("sort") Integer sort);

    boolean updateApproveStateById(Integer id,Integer approveState);

    /**
     * 根据用户ID 查询个人最近9天编辑历史数据
     * @param userId
     * @return
     */
    List<Map<String, Object>> selectMeEditHistory(@Param("userId") String userId);

    /**
     * 查询所有用户最近9天编辑历史数据
     * @return
     */
    List<Map<String, Object>> selectAllEditHistory();

    List<EntryDetailsSubmit> getByPage(@Param("vo")DetailSubmitPageQueryVo vo);

    Long getPageTotalCount(@Param("vo")DetailSubmitPageQueryVo vo);
}
